home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlib43 / mntlib / sysvar.c < prev    next >
C/C++ Source or Header  |  1993-07-06  |  556b  |  31 lines

  1. #include <support.h>
  2. #include <osbind.h>
  3.  
  4. long
  5. get_sysvar(var)
  6.     void *var;
  7. {
  8.     long ret;
  9.     long save_ssp;
  10.     
  11.     save_ssp = (long) Super((void *) 0L);
  12.     /* note: dont remove volatile, otherwise gcc will reorder these
  13.        statements and we get bombs
  14.      */
  15.     ret = *((volatile long *)var);
  16.     (void)Super((void *) save_ssp);
  17.     return ret;
  18. }
  19.  
  20. void
  21. set_sysvar_to_long(var, val)
  22.     void *var;
  23.     long val;
  24. {
  25.     long save_ssp;
  26.     
  27.     save_ssp = (long) Super((void *) 0L);
  28.     *((volatile long *)var) = val;
  29.     (void)Super((void *) save_ssp);
  30. }
  31.